<?php include ('includes/header_print.php');?>
<?php include ('includes/db_connect.php');?>
<?php
    $sql = "SELECT * FROM complaints WHERE id = '".$_GET['id']."'";
    $query = mysql_query($sql);
    $data = mysql_fetch_array($query);

?>
        <div style="padding-left: 20px; padding-right: 20px;">
            <div class="row">
                <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
                    <img src="images/btlogo.png" class="img-responsive" alt="Image" style="margin-top:30px; padding-left:20px">
                </div>
                <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8 text-center">
                    <br>
                    <br>
                    <h1 style="font-size:350% ;font-family: optimum; margin-top:20px">Guest Experience <br> Report</h1>
                </div>
                <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
                    <button onclick="PrintThis()" class="btn btn-default fa fa-print">Print This Page</button>
                    <img src="<?php echo file_exists($data['thumb']) ? $data['thumb'] : 'images/guest.png';?>?<?php echo strtotime(date('Y-m-d H:i:s')); ?>" class="img-responsive" alt="Image" style="padding:2px;border:thin solid black; margin-top:60px">
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <hr color="#0A744B" style="padding:0.5px ">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <strong>Follow Up By:</strong> <?php echo $data['follow_up'] ?>
                    <br>
                    <strong>Created By:</strong> <?php echo $data['created_by'] ?> <span> on </span><?php echo date("M j, Y. H:i", strtotime($data['date_issue'])) ?>
                </div>
            </div>
            <div class="row">
                <table class="table table-bordered">
                    <tbody>
                        <tr>
                            <td rowspan="3" class="text-center" style="vertical-align: middle;"><strong>Date Complaints:</strong><br><?php echo date("M j, Y, H:i", strtotime($data['date_complaint'])) ?></td>
                            <td class="text-center" style="vertical-align: middle;"><b><?php echo $data['guest_name'] ?></b></td>
                            <td class="text-center" style="vertical-align: middle;">#<?php echo $data['villa_no'] ?></td>
                            <td rowspan="3" class="text-center" style="vertical-align: middle;"><strong>Check-In Date:</strong><br><?php echo date("l, M j, Y", strtotime($data['ci_date'])) ?></td>
                            <td rowspan="3" class="text-center" style="vertical-align: middle;"><strong>Check-Out Date:</strong><br><?php echo date("l, M j, Y", strtotime($data['co_date'])) ?></td>
                        </tr>
                        <tr>
                            <td class="text-center"><?php echo $data['nationality'] ?></td>
                            <td rowspan="2" class="text-center" style="vertical-align: middle;"><strong>Source:</strong><br><?php echo $data['source'] ?></td>
                        </tr>
                        <tr>
                            <td class="text-center"><a href="mailto:<?php echo $data['guest_email'] ?>"><?php echo $data['guest_email'] ?></a></td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center pading=2px">
                    <h3 style="font-family:optimum"><?php echo $data['complaint_title'] ?></h3>
                    <h4 class="bg-primary" style="font-family:optimum">Description of Complaint</h4>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td class="text-center"><?php echo nl2br($data['description']) ?></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
                    <h4 class="bg-primary" style="font-family:optimum">Recovery Action</h4>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td class="text-center"><?php echo nl2br($data['recovery']) ?></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-left">
                    <h4 class="bg-primary" style="font-family:optimum">Further Follow Up:</h4>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td class="text-left"><?php echo nl2br($data['further_follow_up']) ?></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <dl>
                        <dt>Compensation:</dt>
                        <dd><?php echo $data['compensation'] ?></dd>
                        <dt>Cost:</dt>
                        <dd>IDR <?php echo number_format($data['price'], 0, '.', ',') ?></dd>
                    </dl>
                </div>
            </div>

            <!-- /.row -->
        </div>
<script>
function PrintThis() {
    window.print();
}
</script>

<?php include ('includes/footer_print.php');?>